﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BUS;
using DTO;
namespace DoAn
{
    public partial class frXemHang : Form
    {
        public frXemHang()
        {
            InitializeComponent();
        }
        public frXemHang(string MaHang):this()
        {
            HangHoaDTO hh = new HangHoaDTO();
            HangHoaBUS hhBus = new HangHoaBUS();
            hh = hhBus.LayHangTheoMa(MaHang);
            LoaiHangDTO lh = new LoaiHangDTO();
            LoaiHangBUS lhbus = new LoaiHangBUS();            
            lh = lhbus.LayLoaiHangTheoMa(hh.MaLoaiHang);            
            NhaCCDTO ncc = new NhaCCDTO();
            NhaCCBUS nccBus = new NhaCCBUS();
            ncc = nccBus.LayNCCTheoMa(hh.MaNCC);

            lbMaHang.Text = hh.MaHang;
            lbTenHang.Text = hh.TenHang;
            lbLoaiHang.Text = lh.TenLoaiHang;
            lbNCC.Text = ncc.TenNCC;
            lbSoLuong.Text = hh.SoLuong.ToString();            
        }

        private void btnDong_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnSua_Click(object sender, EventArgs e)
        {

        }
    }
}
